﻿using Dapper;
using System;
using BCEntity.CRM.EnterpriseInfomation;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.CRM.EnterpriseInfomation
{
    /// <summary>
    /// 企业信息
    /// </summary>
    public interface IEnterpriseInfomationData
    {
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="enterpriseInfomationId">企业信息Id</param>
        Task<bool> Exists(long enterpriseInfomationId);
        /// <summary>
        /// 是否存在企业信息
        /// </summary>
        /// <param name="companyName">公司名称</param>
        Task<bool> ExistsByCompanyName(string companyName);
        /// <summary>
        /// 是否存在企业信息
        /// </summary>
        /// <param name="socialUniformCode">社会统一代码</param>
        Task<bool> ExistsBySocialUniformCode(string socialUniformCode);
        /// <summary>
        /// 增加企业信息
        /// </summary>
        /// <param name="entity">企业信息信息</param>
        Task<EnterpriseInfomationEntity> Add(EnterpriseInfomationEntity entity);
        /// <summary>
        /// 导入企业信息
        /// </summary>
        /// <param name="entities">企业信息信息</param>
        void Import(List<EnterpriseInfomationEntity> entities);
        /// <summary>
        /// 更新企业信息
        /// </summary>
        /// <param name="entity">企业信息信息</param>
        Task<EnterpriseInfomationEntity> Update(EnterpriseInfomationEntity entity);
        /// <summary>
        /// 删除企业信息
        /// </summary>
        /// <param name="enterpriseInfomationId">企业信息Id</param>
        Task<bool> Delete(long enterpriseInfomationId);
        /// <summary>
        /// 获取企业信息
        /// </summary>
        /// <param name="enterpriseInfomationId">企业信息Id</param>
        Task<EnterpriseInfomationEntity> GetEntity(long enterpriseInfomationId);
        /// <summary>
        /// 获取企业信息列表
        /// </summary>
        Task<IEnumerable<EnterpriseInfomationEntity>> GetList();
        /// <summary>
        /// 获取企业信息分页列表
        /// </summary>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        Task<(IEnumerable<EnterpriseInfomationEntity>, int)> Query(DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法
    }


}